<!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>

<!-- 
1
<ul id="v-for-object" class="demo">
  <li v-for="value in object">
    {{ value }}
  </li>
</ul>
-->

<!-- 
2
 <ul id="v-for-object" class="demo">
  <li v-for="(value, name) in object">
    {{ name }} : {{ value }}
  </li>
</ul>
 -->
 

 <ul id="v-for-filter" class="demo">
  <li v-for="n in evenNumbers">{{ n }}</li>
</ul> <!-- 
3
 -->
<script>
var vm = new Vue({
	el: '#v-for-filter',
	data: {
	  numbers: [ 1, 2, 3, 4, 5 ]
	},
	computed: {
	  evenNumbers: function () {
		return this.numbers.filter(function (number) {
		  return number % 2 === 0
		})
	  }
	}
})
</script>

<!--
过滤出偶数
-->